/**
 *  @下载文件流
 *
 */
import {saveAs} from 'file-saver'

export function DownloadFile(data, filename = '') {
    console.log(filename)
    if (!data) {
        return
    }
    saveAs(data, filename)
}

export function removeHTMLTags(str) {
  return str.replace(/<[^>]*>/g, '');
 }

export function isEmail(email) {
    let reg = /^([a-zA-Z\d])(\w|\-)+@[a-zA-Z\d]+\.[a-zA-Z]{2,4}$/
    return reg.test(email)
}

export function isUrl(url) {
    let reg = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
    return reg.test(url)
}

